/**
 * 判断是否是在微信中
 * @returns {boolean}
 */
export function isWeiXin() {
    let ua = navigator.userAgent.toLowerCase();
    if (ua.match(/MicroMessenger/i) == "micromessenger")
        return true;
    else
        return false;
}

/**
 * 是否微信5之后
 * @returns {boolean}
 */
export function isWeiXin5() {
    let wechatInfo = navigator.userAgent.match(/MicroMessenger\/([\d\.]+)/i);
    if (!wechatInfo) {
        return false;
    } else if (wechatInfo[1] < "5.0") {
        return false;
    }
    return true;
}